home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-04-02 | 4.0 KB | 90 lines | [TEXT/MPS ] |
- {
- graphics:
- math routines
- by Cary Clark, Georgiann Delaney, Michael Fairman, Dave Good, Robert Johnson, Keith McGreggor, Oliver Steele, David Van Brink, Chris Yerga
- Copyright 1987 - 1991 Apple Computer, Inc. All rights reserved.
- }
-
- {$IFC UNDEFINED UsingIncludes}
- {$SETC UsingIncludes := 0}
- {$ENDC}
-
- {$IFC NOT UsingIncludes}
- UNIT MathRoutines;
- INTERFACE
- {$ENDC}
-
- {$IFC UNDEFINED UsingMathRoutines}
- {$SETC UsingMathRoutines := 1}
-
-
- {$I+}
- {$SETC MathRoutinesIncludes := UsingIncludes}
- {$SETC UsingIncludes := 1}
- {$IFC UNDEFINED UsingMathTypes}
- {$I $$Shell(PInterfaces)MathTypes.p}
- {$ENDC}
- {$SETC UsingIncludes := MathRoutinesIncludes}
-
-
- FUNCTION CopyToMapping(VAR target: GxMapping; source: GxMappingPointer): GxMappingPointer; C;
- FUNCTION InvertMapping(VAR target: GxMapping; source: GxMappingPointer): GxMappingPointer; C;
- FUNCTION MapMapping(VAR target: GxMapping; source: GxMappingPointer): GxMappingPointer; C;
- FUNCTION MoveMapping(VAR target: GxMapping; hOffset, vOffset: Fixed): GxMappingPointer; C;
- FUNCTION MoveMappingTo(VAR target: GxMapping; hPosition, vPosition: Fixed): GxMappingPointer; C;
- FUNCTION NormalizeMapping(VAR target: GxMapping): GxMappingPointer; C;
- FUNCTION RotateMapping(VAR target: GxMapping; angle, xCenter, yCenter: Fixed): GxMappingPointer; C;
- FUNCTION ScaleMapping(VAR target: GxMapping; hFactor, vFactor, xCenter, yCenter: Fixed): GxMappingPointer; C;
- FUNCTION ResetMapping(VAR target: GxMapping): GxMappingPointer; C;
- FUNCTION SkewMapping(VAR target: GxMapping; skewX, skewY, xCenter, yCenter: Fixed): GxMappingPointer; C;
-
- PROCEDURE MapPoints(source: GxMappingPointer; count: LongInt; VAR vector: GxPoint); C;
-
- FUNCTION FirstBit(anUnsignedLong: UnsignedLong): Integer; C;
- FUNCTION WideScale(source: GxWidePointer): Integer; C;
-
- FUNCTION LinearRoot(first, last: Fixed; VAR t: Fract): Integer; C;
- FUNCTION QuadraticRoot(first, control, last: Fixed; VAR t: Fract): Integer; C;
-
- FUNCTION PolarToPoint(aGxPolarPointer: GxPolarPointer; VAR aGxPoint: GxPoint): GxPointPointer; C;
- FUNCTION PointToPolar(aGxPointPointer: GxPointPointer; VAR aGxPolar: GxPolar): GxPolarPointer; C;
-
- FUNCTION FractCubeRoot(source: Fract): Fract; C;
- FUNCTION FractDivide(dividend, divisor: Fract): Fract; C;
- FUNCTION FractMultiply(multiplicand, multiplier: Fract): Fract; C;
- FUNCTION FractSineCosine(degrees: Fixed; VAR cosine: Fract): Fract; C;
- FUNCTION FractSquareRoot(source: Fract): Fract; C;
-
- FUNCTION FixedDivide(dividend, divisor: Fixed): Fixed; C;
- FUNCTION FixedMultiply(multiplicand, multiplier: Fixed): Fixed; C;
-
- { This next call is (source * multiplier / divisor) -- it avoids underflow, overflow by using wides }
- FUNCTION MultiplyDivide(source, multiplier, divisor: LongInt): LongInt; C;
-
- FUNCTION Magnitude(deltaX, deltaY: LongInt): UnsignedLong; C;
- FUNCTION VectorMultiplyDivide(count: LongInt; vector1: LongIntPointer; step1: LongInt; vector2: LongIntPointer; step2, divisor: LongInt): LongInt; C;
-
- FUNCTION WideAdd(VAR target: GxWide; source: GxWidePointer): GxWidePointer; C;
- FUNCTION WideCompare(target, source: GxWidePointer): Integer; C;
- FUNCTION WideNegate(VAR target: GxWide): GxWidePointer; C;
- FUNCTION WideShift(VAR target: GxWide; shift: LongInt): GxWidePointer; C;
- FUNCTION WideSquareRoot(source: GxWidePointer): UnsignedLong; C;
- FUNCTION WideSubtract(VAR target: GxWide; source: GxWidePointer): GxWidePointer; C;
-
- FUNCTION WideMultiply(multiplicand, multiplier: LongInt; VAR target: GxWide): GxWidePointer; C;
- FUNCTION WideDivide(dividend: GxWidePointer; divisor: LongInt; VAR remainder: LongInt): LongInt; C; { returns the quotient }
- FUNCTION VectorMultiply(count: LongInt; vector1: LongIntPointer; step1: LongInt; vector2: LongIntPointer;
- step2: LongInt; VAR dot: GxWide): GxWidePointer; C;
- FUNCTION WideWideDivide(VAR dividend: GxWide; divisor: LongInt; VAR remainder: LongInt): GxWidePointer; C; { quotient replaces dividend }
-
- FUNCTION RandomBits(count, focus: LongInt): UnsignedLong; C;
- PROCEDURE SetRandomSeed(seed: GxWidePointer); C;
- FUNCTION GetRandomSeed(VAR seed: GxWide): GxWidePointer; C;
-
-
- {$ENDC}
-
- {$IFC NOT UsingIncludes}
- END.
- {$ENDC}
-